package com.dorukdestan.p2pshare.utiltest;

import java.net.*;
import java.util.*;

public class MyIpAddress
{
    public static void main(String[] args)
        throws Exception // Just for simplicity
    {
        for (Enumeration<NetworkInterface> ifaces = 
               NetworkInterface.getNetworkInterfaces();
             ifaces.hasMoreElements(); )
        {
            NetworkInterface iface = ifaces.nextElement();

            if(!iface.getName().equals("lo")){
            	for(Enumeration<InetAddress> inetadds = iface.getInetAddresses();
            		inetadds.hasMoreElements(); ){
            		InetAddress address = inetadds.nextElement();
                    System.out.println( address.getHostAddress().contains(":") ? "" : address.getHostAddress());

            	}

            		
            }
        }
    }
}

